<!DOCTYPE html>
<html lang="en">
<head>
      <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>全局组件</title>
      <script src="vue.js"></script>
      <!-- <script src="vue-router.min.js"></script> -->
</head>
<body>
  <div id="id-div-comp">
        <comp-title></comp-title>
        <comp-content></comp-content>
        <comp-conter></comp-conter>
      </div>
  <script>
    Vue.component('comp-title',{
        template: '<h3>Title - Vue.js Global Component</h3>'
    });
    Vue.component('comp-content',{
        template: '<p>这是一个vue组件</p >'
    });
    Vue.component('comp-conter',{
        data: function() {
            return {
                count: 0
            }
        },
        template: '<button v-on:click="count++"> You clicked me {{ count }} times. </button>'
    });
    var vm = new Vue({
        el: '#id-div-comp'
    });
</script>
</body>
</html>